const { Success } = require('../../core/http-exception')

function success(msg, errorCode) {
  throw new Success(msg, errorCode)
}

class BaseResult {
  constructor(msg, errorCode) {
    this.msg = msg
    this.errorCode = errorCode
  }
}
class SuccessResult extends BaseResult {
  constructor(data) {
    super('success', 0)
    if(data) this.data = data
  }
}

module.exports = {
  success,
  SuccessResult
}